import request from '@/utils/request'

// 查询数据对象列表
export function listDataObject(query) {
  return request({
    url: '/common/dataobject/list',
    method: 'get',
    params: query
  })
}
export function getDataObjectList(){
  return request({
    url: '/common/dataobject/list',
    method: 'get',
  })
}
export function deleteDataObject(objectId){
  return request({
    url: '/common/dataobject/delete',
    method: 'get',
    params: {objectId:objectId}
  })
}
export function getDataObject(query) {
  return request({
    url: '/common/dataobject/getDataObject',
    method: 'get',
    params: query
  })
}
export function getDetail(objectId) {
  return request({
    url: '/common/dataobject/getDetail',
    method: 'get',
    params: {objectId: objectId}
  })
}
export function uploadFile(data) {
  return request({
    url: '/common/datasource/file/upload',
    method: 'post',
    data: data,
  })
}
export function getTopData(fileId) {
  return request({
    url: '/common/datasource/file/getTopData',
    method: 'get',
    params: {fileId:fileId}
  })
}
export function getParsedFile() {
  return request({
    url: '/common/datasource/file/list',
    method: 'get',
    params: {}
  })
}
export function addDataObject(obj) {
  return request({
    url: '/common/dataobject/add',
    method: 'post',
    data:obj
  })
}
export function getFileColumns(fileId) {
  return request({
    url: '/common/datasource/file/getColumns',
    method: 'get',
    params: {fileId:fileId}
  })
}
export function jdbcDsList(query) {
  return request({
    url: 'http://10.177.23.234:8069/api/jobJdbcDatasource',
    method: 'get',
    query:query,
  })
}

export function getTables(obj) {
  return request({
    url: 'http://10.177.23.234:8069/api/jdbcDatasourceQuery/getTables',
    method: 'get',
    params:obj,
  })
}
export function getColumns(obj) {
  return request({
    url: 'http://10.177.23.234:8069/api/jdbcDatasourceQuery/getColumns',
    method: 'get',
    params:obj,
  })
}

